package br.com.agileplus.linkedcompany.service.dao.generic;

import java.io.Serializable;
import java.util.List;

import org.hibernate.criterion.Criterion;

import br.com.agileplus.linkedcompany.domain.ModeloBase;

/**
 * Interface de Persistencia Generica.
 * @author Luis Garcia
 */
public interface IGenericDAO< T extends ModeloBase, PK extends Serializable > {

	public T findById ( PK id, boolean lock );
	public T findById ( PK id);
	public PK save ( T entity );
	public T update ( T entity );
	public T saveOrUpdate ( T entity );
	public void delete ( T entity );
	public List<? extends ModeloBase> findAll ();
	public List<? extends ModeloBase> findByCriteria(Criterion... criterion);
	public void flush();
	public void clear();

}